package com.example.healthcondition.entity;

import java.time.LocalDate;

public class HealthReports {
    private Integer report_id;
    private Integer user_id;
    private LocalDate report_date;
    private String overall_health;
    private String recommendations;

    // 默认构造函数
    public HealthReports() {
    }

    // 带所有属性的构造函数
    public HealthReports(Integer report_id, Integer user_id, LocalDate report_date, String overall_health, String recommendations) {
        this.report_id = report_id;
        this.user_id = user_id;
        this.report_date = report_date;
        this.overall_health = overall_health;
        this.recommendations = recommendations;
    }

    // Getter和Setter方法
    public Integer getReportId() {
        return report_id;
    }

    public void setReportId(Integer report_id) {
        this.report_id = report_id;
    }

    public Integer getUserId() {
        return user_id;
    }

    public void setUserId(Integer user_id) {
        this.user_id = user_id;
    }

    public LocalDate getReportDate() {
        return report_date;
    }

    public void setReportDate(LocalDate report_date) {
        this.report_date = report_date;
    }

    public String getOverallHealth() {
        return overall_health;
    }

    public void setOverallHealth(String overall_health) {
        this.overall_health = overall_health;
    }

    public String getRecommendations() {
        return recommendations;
    }

    public void setRecommendations(String recommendations) {
        this.recommendations = recommendations;
    }

    // toString方法
    @Override
    public String toString() {
        return "HealthReports{" +
                "report_id=" + report_id +
                ", user_id=" + user_id +
                ", report_date=" + report_date +
                ", overall_health='" + overall_health + '\'' +
                ", recommendations='" + recommendations + '\'' +
                '}';
    }

    // hashCode和equals方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        HealthReports that = (HealthReports) o;
        return report_id != null && report_id.equals(that.report_id);
    }

    @Override
    public int hashCode() {
        return report_id != null ? report_id.hashCode() : 0;
    }
}